package cn.bocai.pc.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/file")
public class FolderToReadController {

    /** 
     * 彩色和黑白图片扫描使用的方法 
     * @param  variables 是变量彩色页面过来的就是col，黑白页面过来的就是black
     * @param  year 获取下拉选择的年份
     * @param  periods 获取下拉选择的期数信息
     * @version 2015.06.30 
     * @author chenhao 
     * 
     */  
	@RequestMapping("/readFile/{variables}.do")
	public String readFile(@PathVariable String variables,HttpServletRequest request,Model m){
		if("col".equals(variables)){
			 m.addAttribute("skipUrl","/skip/colScan.do");
		}else{
			 m.addAttribute("skipUrl","/skip/blaScan.do");
		}
		String year = request.getParameter("year");
		String periods = request.getParameter("periods");
		if("请选择".equals(year)||"请选择".equals(periods)){
			 m.addAttribute("msg","选择年份或期数不能为空");
		}else{
			//这里编写逻辑
			
			 m.addAttribute("msg","路径扫描成功");
		}
		 return "page/prompt/publicPrompt";
	}
}
